#!/usr/bin/env bash
# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
# Function :等保系统检查
# Platform :RedHatEL7.x Based Platform
# Version  :1.12
# Date     :2022-03-31
# Author   :mugoLH
# Contact  :hxsaj@126.com
# 使用方式  :
# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
info_p(){  printf "\e[1;35;40m%-8s %-26s %-24s %-2s %-2s\e[0m\n" "$(date '+%H:%M:%S')" "${1}" "${2}" "${3}" "${4}" >&1 ;}
error_p(){ printf "\e[1;35;40m%-8s\e[0m %-12s %-1s\n\e[0m"      "$(date '+%H:%M:%S')" "${1}" "${2}"  >&1 ;}


chack_defs(){
	info_p "[ 密码最长过期天数 ]" ":" "$(awk '/^PASS_MAX_DAYS/{print$2}' /etc/login.defs)"
	info_p "[ 密码最小过期天数 ]" ":" "$(awk '/^PASS_MIN_DAYS/{print$2}' /etc/login.defs)"
	info_p "[ 密码最小长度 ]"    ":" "$(awk '/^PASS_MIN_LEN/{print$2}' /etc/login.defs)"
	info_p "[ 密码过期警告天数 ]" ":" "$(awk '/^PASS_WARN_AGE/{print$2}' /etc/login.defs)"
}


